package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ProductStockOutMapper;
import com.ruoyi.system.domain.ProductStockOut;
import com.ruoyi.system.service.IProductStockOutService;

/**
 * 商品出库 Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-30
 */
@Service
public class ProductStockOutServiceImpl implements IProductStockOutService
{
    @Autowired
    private ProductStockOutMapper productStockOutMapper;

    /**
     * 通过id查询商品出库
     *
     * @param id 商品出库主键
     * @return 商品出库
     */
    @Override
    public ProductStockOut selectProductStockOutById(Long id)
    {
        return productStockOutMapper.selectProductStockOutById(id);
    }

    /**
     * 通过仓库名称查询商品出库列表
     *
     * @param warehouseName 仓库名称
     * @return 商品出库
     */
    @Override
    public List<ProductStockOut> selectProductStockOutListByName(String warehouseName)
    {
        return productStockOutMapper.selectProductStockOutListByName(warehouseName);
    }

    /**
     * 新增商品出库
     *
     * @param productStockOut 商品出库
     * @return 结果
     */
    @Override
    public int insertProductStockOut(ProductStockOut productStockOut)
    {
        return productStockOutMapper.insertProductStockOut(productStockOut);
    }

    /**
     * 修改商品出库
     *
     * @param productStockOut 商品出库
     * @return 结果
     */
    @Override
    public int updateProductStockOut(ProductStockOut productStockOut)
    {
        return productStockOutMapper.updateProductStockOut(productStockOut);
    }

    /**
     * 通过id批量删除商品出库信息
     *
     * @param ids 需要删除的商品出库主键
     * @return 结果
     */
    @Override
    public int deleteProductStockOutByIds(Long[] ids)
    {
        return productStockOutMapper.deleteProductStockOutByIds(ids);
    }

    /**
     * 通过id删除商品出库信息
     *
     * @param id 商品出库主键
     * @return 结果
     */
    @Override
    public int deleteProductStockOutById(Long id)
    {
        return productStockOutMapper.deleteProductStockOutById(id);
    }
}
